package org.summerframework.component.upload;

import lombok.Getter;

import java.io.IOException;
import java.io.InputStream;

/**
 * @author 石超
 * @version v1.0.0
 */
@Getter
public class DownloadInputSteam extends InputStream {
    private InputStream inputStream;
    private String fileName;

    public DownloadInputSteam(InputStream inputStream, String fileName) {
        super();
        this.inputStream = inputStream;
        this.fileName = fileName;
    }

    @Override
    public int read() throws IOException {
        return inputStream.read();
    }

    @Override
    public int read(byte[] b) throws IOException {
        return inputStream.read(b);
    }

    @Override
    public int read(byte[] b, int off, int len) throws IOException {
        return inputStream.read(b, off, len);
    }

    @Override
    public long skip(long n) throws IOException {
        return inputStream.skip(n);
    }

    @Override
    public void close() throws IOException {
        inputStream.close();
    }

    @Override
    public int available() throws IOException {
        return super.available();
    }
}
